package com.zz.impl;

import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigurationPackage;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import com.zz.dao.MembershipsDao;
import com.zz.entity.Memberships;
import com.zz.service.MembershipsService;
@Service
public class MembershipsImpl implements MembershipsService {
@Autowired
MembershipsDao membershipsDao;

@Override
public List<Memberships> findAll() {
	// TODO Auto-generated method stub
	return membershipsDao.findAll();
}

@Override
public Integer delete(Integer id) {
	try {
		membershipsDao.deleteById(id);
		return 1;
	} catch (Exception e) {
		return 0;
	}
}

@Override
public Integer save(Memberships m) {
	membershipsDao.save(m);
	return 1;
}


	

	

}
